package com.gjad.www.controller;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eastdigit.servlet.ReqBean;
import com.eastdigit.servlet.RequestAttribute;
import com.eastdigit.servlet.Response;
import com.gjad.www.service.MediaQueryService;

@Controller
@RequestMapping(value = "/anon/www/media")
public class MediaQueryController {

    @Autowired
    private MediaQueryService mediaQueryService;

    @RequestMapping(value = "/lines")
    @ResponseBody
    public JSONObject queryLineMedias(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) throws Exception {
    	 return Response.response(mediaQueryService.findLineMedias(reqBean));
    }
    
    @RequestMapping(value = "/stops")
    @ResponseBody
    public JSONObject queryStopMedias(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) throws Exception {
    	 return Response.response(mediaQueryService.findStopMedias(reqBean));
    }
    
    @RequestMapping(value = "/others")
    @ResponseBody
    public JSONObject queryOtherMedias(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) throws Exception {
    	 return Response.response(null);
    }
    
   
   
    
}